package com.egg.gateway.filter.secure;

import lombok.Data;
import org.springframework.cloud.gateway.filter.factory.rewrite.RewriteFunction;

@Data
public class RewriteConfig {


    private Class inClass;
    private Class outClass;
    private String contentType;
    private RewriteFunction rewriteFunction;


    public <T, R> RewriteConfig init(
            Class<T> inClass
            , Class<R> outClass
            , RewriteFunction<T, R> rewriteFunction
    ) {
        setInClass(inClass);
        setOutClass(outClass);
        setRewriteFunction(rewriteFunction);
        return this;
    }

    public String getContentType() {
        return "application/json;charset=utf-8";
    }


}
